package com.bruce.pattern.behavioral.templatemethod;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by bruce on 2018/11/9 23:55
 */
@Slf4j
public abstract class AbstractCourse {
    /** 录制课程 */
    protected final void makeCourse() {
        this.makePpt();
        this.makeVideo();
        if (needWriteArticle()) {
            this.makeArticle();
        }
        this.packageCourse();
    }

    final void makePpt() {
        log.info("制作PPT");
    }

    final void makeVideo() {
        log.info("制作Vedio");
    }

    final void makeArticle() {
        log.info("制作文档");
    }

    /** 钩子方法 */
    protected boolean needWriteArticle() {
        return false;
    }

    abstract void packageCourse();


}
